---
title: "Burden Measure Analysis"
author: "Alisa Bedrov"
date: "3/6/2022"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(haven)
library(psych)
library(ggpubr)
library(apaTables)
library(tidyverse)
library(rstatix)

data <- read_csv("study3_dat.csv")
```
### Data Screening
```{r}
data %>% select(-ID) %>% summary()
data %>% select(-ID) %>% describe()

data2 <- read_csv("study4_dat.csv")
data2 %>% select(-ID) %>% summary()

ggdensity(data$rep, fill="lightgray") #kurtosis = -1.38
ggdensity(data$guilt, fill="lightgray") #kurtosis = -1.35
ggdensity(data$expec, fill="lightgray") #kurtosis = -1.06
ggdensity(data$lie, fill="lightgray") #kurtosis = -1.07
ggdensity(data$uncomf, fill="lightgray") #skew = -1.19
ggdensity(data$avoid, fill="lightgray") #skew = 0.80

ggdensity(data$burden, fill="lightgray") #kurtosis = -1.04

ggdensity(data$rum, fill="lightgray") 
ggdensity(data$stress, fill="lightgray")
ggdensity(data$eff, fill="lightgray")
ggdensity(data$diff, fill="lightgray")
ggdensity(data$distract, fill="lightgray")
ggdensity(data$adjust, fill="lightgray")
ggdensity(data$interact, fill="lightgray")
ggdensity(data$authen, fill="lightgray")
ggdensity(data$obligate, fill="lightgray")
ggdensity(data$life_bw, fill="lightgray")
ggdensity(data$consq, fill="lightgray")

data %>% shapiro_test(rum)
data %>% shapiro_test(stress)
data %>% shapiro_test(eff)
data %>% shapiro_test(diff)
data %>% shapiro_test(distract)
data %>% shapiro_test(adjust)
data %>% shapiro_test(lie)
data %>% shapiro_test(avoid)
data %>% shapiro_test(dist)
data %>% shapiro_test(interact)
data %>% shapiro_test(authen)
data %>% shapiro_test(obligate)
data %>% shapiro_test(expec)
data %>% shapiro_test(guilt)
data %>% shapiro_test(uncomf)
data %>% shapiro_test(rep)
data %>% shapiro_test(life_bw)
data %>% shapiro_test(consq)
data %>% shapiro_test(burden)


t.test(data$burden, data2$burden)
```

### Factor Scale Reliability
```{r}
library(ltm)
f1 <- data %>% select(rum:avd)
cronbach.alpha(f1)

f2 <- data %>% dplyr::select(dstn:aut)
cronbach.alpha(f2)

f3 <- data %>% dplyr::select(obl:glt)
cronbach.alpha(f3)

data$lfe <- 8 - data$lfe
data$cnsq <- 8-data$cnsq
f4 <- data %>% dplyr::select(uncf:cnsq) 
cronbach.alpha(f4, na.rm=T)
```


